{extend name="sitehome@style/base"/}
{block name="resources"}
<style>
	.nui-container .nui-container-block{background: #F9F9F9;overflow: hidden;line-height: 35px;padding: 30px;}
	.nui-container-block > div.block-l{width: 60%;}
	.nui-container-block > div{float: left;display: inline-block;}
	.nui-container-block > div.block-r{width: 35%;border-left: 1px solid #D6D6D6;padding-left: 20px;height: 126px;}
	.block-l .l-title{color: #44BB01;font-size: 17px}
	.block-l .l-btn{width: 150px;background: #44BB01;color: #C4FFA1;padding: 6px 61px;margin-top: 13px;border-radius: 3px;cursor: pointer;}
	.block-l .l-btn img{width: 28px;margin-right: 10px;}
	.l-introduce, .r-introduce{color: #B0B0B0;font-size: 12px;line-height: 25px;}
</style>
{/block}
{block name="main"}
	<div class="nui-container">
	
		<div class="nui-container-block margin-bottom-clear">
			<div class="block-l">
				<p class="l-title">绑定微信公众号，把网站和微信打通</p>
				<a href="{:addon_url('Wechat://sitehome/config/config')}"><div class="l-btn" > 
					<img src="ADDON_WECHAT_IMG/index_weixin.png" alt="" />
					<span>微信公众号设置</span>
				</div></a>
			</div>
			<div class="block-r" >
				<p class="r-title">温馨提示：</p>
				<p class="r-introduce">一个微信公众号只能和一个站点绑定</p>
			</div>
		</div>
		
		{if condition="$count neq 0"}
		<div class="nui-container-block">
			<div class="block-l">
				<p class="l-title author_l_title">绑定开放平台</p>
				<p class="l-introduce">绑定后即可在这里管理你的公众号，牛云提供比微信官方后台更强大的功能！</p>
				<div class="l-btn author_l_btn" onclick="auth()">
					<img src="ADDON_WECHAT_IMG/index_author.png" alt="" />
					<span>微信授权添加</span>
				</div>
			</div>
			<div class="block-r">
				<p class="r-title">温馨提示：</p>
				<p class="r-introduce">一个微信公众号只能和一个站点绑定</p>
				<p class="r-introduce">99%的用户选择了这种方式，简单方便，推荐新用户在这里添加绑定公众号</p>
			</div>
		</div>
		{/if}
	</div>
{/block}
{block name="script"}
<script type="text/javascript">
function auth(){
	window.open("{:addon_url('Wechat://common/config/auth')}");
	layer.confirm('请在新窗口中完成微信公众号授权  <a href="" style="color:#1E9FFF;">查看授权教程</a>', {
	  btn: ['已成功设置','授权失败重试']
	}, function(){
		location.reload();
	}, function(){
		auth();
	});
}
</script>
{/block}